<?php
include('init.php');
$act = isset($_REQUEST['act'])?$_REQUEST['act']:'';
?>
<?php include 'header.php' ?>
<?php include 'index_top.php' ?>

<div class="viewhistorydiv">
<div>
<input type="button" value="今天" class="button" onclick="document.location='?type=<?php echo RecordsHelper::$TYPE_TODAY;?>';"/>&nbsp;
<input type="button" value="三天" class="button" onclick="document.location='?type=<?php echo RecordsHelper::$TYPE_THREE_DAY;?>';"/>&nbsp;
<input type="button" value="一周" class="button" onclick="document.location='?type=<?php echo RecordsHelper::$TYPE_WEEK;?>';"/>&nbsp;
<input type="button" value="一个月" class="button" onclick="document.location='?type=<?php echo RecordsHelper::$TYPE_MONTH;?>';"/>&nbsp;
<br>
<hr>
<?php
$type = isset($_REQUEST['type'])?$_REQUEST['type']:'today';
$helper = new RecordsHelper();
$data_list = $helper->getRecordsByType($type);
//if(count($data_list) > 0)
//{
$viewer = RecordsView::getViewByType($type);
$viewer->setDataSource($data_list);
$viewer->display();
//}else{
	//echo 'No data';
//}
?>
</div>
</div>
<?php include 'footer.php' ?>